package com.library_manager_system.utils;

import java.util.ArrayList;
import java.util.Iterator;

import com.library_manager_system.Book;

public class GetBookByName {
	
	public static Book getBookByName(ArrayList<Book> arraylist,String Inname){
		
	
		Iterator<Book> it = arraylist.iterator();
		while(it.hasNext()){
			Book book = it.next();
			if(Inname.equals(book.getBook_name())){
				
				
				return book;
			}
		}
		
		//找不到则返回空
		return null;
	}

}
